home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Code Resources / Jims CDEFs 1.50 / demo Source ƒ / demoDialog.h < prev    next >
Encoding:
Text File  |  1995-10-27  |  2.8 KB  |  112 lines  |  [TEXT/KAHL]

  1. // -----------------------------------------------------------------------------
  2. //    File        : demoDialog.h
  3. //    Date        : August 24, 1994
  4. //    Author        : Jim Stout
  5. //    Purpose        : header file for demoDialog.c
  6. //
  7. // -----------------------------------------------------------------------------
  8. #define MAXFONTSIZES 5
  9. #define TABCNTL 3            // the DITL item number for the tabPanel CDEF
  10. #define BGCOLOR    4            // background color popUp
  11. #define BGPAT 5
  12. #define STDCTLS 6            // OK, Cancel, Tab, BGColor, BGPat, Disable on all panels
  13.  
  14. // the types of panels we demo
  15.  
  16. enum {
  17.     BUTTONS = 1,
  18.     POPUPS,
  19.     SPINNERS,
  20.     DATETIME,
  21.     HSLIDERS,
  22.     VSLIDERS,
  23.     PROGBARS,
  24.     POPUPEXT
  25. };
  26.  
  27. enum {                            // controls on the BUTTONS panel
  28.     DISABLE = STDCTLS,
  29.     CB1,
  30.     CB2,
  31.     CB3,
  32.     CB4,
  33.     RB1,
  34.     RB2,
  35.     RB3,
  36.     RB4,
  37.     TB1,
  38.     TB2,
  39.     TB3,
  40.     TB4,
  41.     PB1,
  42.     PB2,
  43.     FONTPOP,
  44.     ST1,
  45.     EDITSIZE,
  46.     SIZEPOP,
  47.     SETFONT
  48. };
  49. enum {                            // controls on the SPINNERS panel
  50.     SPIN1 = STDCTLS+1,
  51.     SPIN2,
  52.     SPIN3,
  53.     SPIN4,
  54.     SPIN5,
  55.     SPIN6,
  56.     SPIN7,
  57.     SPIN8,
  58.     EDITSPIN,
  59.     FRACTSPIN
  60. };
  61.  
  62. #define RESET       STDCTLS+14    // on DATETIME panel
  63.  
  64.  
  65. #define HSLIDER3       STDCTLS+3    // items on the HSLIDER panel
  66. #define HSLIDER9       STDCTLS+9
  67. #define HSLIDERVAL3    STDCTLS+11
  68. #define HSLIDERVAL9 STDCTLS+12
  69.  
  70. #define VSLIDER5       STDCTLS+5    // items on the VSLIDER panel
  71. #define VSLIDERVAL5 STDCTLS+10
  72.  
  73. #define PROG9 STDCTLS+9            // controls on the PROGBARS panel
  74. #define SPIN10 STDCTLS+10
  75.  
  76. // -----------------------------------------------------------------------------
  77. // public routines
  78. // -----------------------------------------------------------------------------
  79.  
  80. extern void            demoDialog        (void);
  81. extern void            comparePopup    (void);
  82. extern void            dynMenu            (void);
  83. extern void            demoBoxes        (void);
  84. extern void            demoButtons        (void);
  85.  
  86. // -----------------------------------------------------------------------------
  87. // local routines
  88. // -----------------------------------------------------------------------------
  89.  
  90. static void            processPanel    (DialogPtr theDialog, short currPanel, 
  91.                                         short itemHit);
  92. static void            savePanel        (DialogPtr theDialog, short toPanel);
  93. static void            restorePanel    (DialogPtr theDialog, short toPanel);
  94.  
  95. static pascal char    filter            (DialogPtr theDialog, EventRecord *theEvent, 
  96.                                         short *theItem);
  97. static pascal void    trackSpin        (ControlHandle c, short p);
  98. static pascal void    trackSlider        (ControlHandle c, short p);
  99. static pascal void    fractSpin        (ControlHandle c, short p);
  100.  
  101. static void            changeBGColor    (DialogPtr theDialog);
  102. static void            changeBGPat        (DialogPtr theDialog, Boolean redraw);
  103. static void         setNewFont        (DialogPtr theDialog);
  104.  
  105. static void         changeFont        (DialogPtr theDialog, short newFont, 
  106.                                         long newSize);
  107. static void            adjustSizePopup    (DialogPtr theDialog, long newSize);
  108.  
  109. static short        findSystemFont    (DialogPtr theDialog);
  110.  
  111. static pascal char    filterCompare    (DialogPtr theDialog, EventRecord *theEvent, 
  112.                                         short *theItem);